import 'package:flutter/material.dart';


class MyStepper extends StatefulWidget{
  @override
  MyStepperState createState() {
    // TODO: implement createState
    return MyStepperState();
  }
}

class MyStepperState extends State<MyStepper>{
  int _step=0;

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    
    return Scaffold(
      appBar: AppBar(
        title: Text("Stepper步骤视图"),
      ),
      body: Container(
        child: Column(
          children: <Widget>[
            Stepper(
              currentStep: _step,
//              onStepTapped: (value){
//                setState(() {
//                  _step=value;
//                });
//              },
              onStepContinue: (){
                setState(() {
                  _step<2?_step+=1:_step=2;
                });
              },
              onStepCancel: (){
                setState(() {
                  _step>0?_step-=1:_step=0;
                });
              },
              steps: [
                Step(
                  title: Text('注册'),
                  subtitle: Text('成为新用户'),
                  content: Text('使用手机号或者邮箱作为用户名，仅限中国大陆地区，海外及台湾用户只需要使用Facebook账号登录即可'),
                  isActive: _step==0,

                ),
                Step(
                    title: Text('标题1'),
                    subtitle: Text('副标题'),
                    content: Text('内容'),
                    isActive: _step==1
                ),
                Step(
                    title: Text('标题1'),
                    subtitle: Text('副标题'),
                    content: Text('内容'),
                    isActive: _step==2
                )
              ],
            )
          ],
        ),
      ),
    );
  }
}
